import 'dart:convert';

import 'app_style.dart';

class Channel {
  late String channelUrl;
  late String channelName;
  late String channelLogo;
  late String channelId;
  late String channelCode;
  late AppStyle appStyle;

  Channel.fromJson(Map<String, dynamic> json) {
    channelUrl = json['channelUrl'];
    channelName = json['channelName'];
    channelLogo = json['channelLogo'] ?? "";
    channelId = json['channelId'];
    channelCode = json['channelCode'];
    appStyle = AppStyle.fromJson(jsonDecode(json['appStyleJson'] ?? '{}'));
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = {};
    data['channelUrl'] = channelUrl;
    data['channelName'] = channelName;
    data['channelLogo'] = channelLogo;
    data['channelId'] = channelId;
    data['channelCode'] = channelCode;
    data['appStyleJson'] = appStyle.toJson();
    return data;
  }
}
